import SMERouter from 'sme-router';
import adminList from "@/views/adminList";
import advList from "@v/advList";
const router = new SMERouter('root',"html5");
// 请求地址为/index/adminList，呈现的内容为：管理员界面
router.route("/index/adminList",(req,res)=>{
	console.log(adminList());// <h3>adminList</h3>
	// 指定呈现的内容（指定挂载内容）
	res.render(adminList());
})
// 请求地址为/index/advList，呈现的内容为：广告界面
router.route("/index/advList",(req,res)=>{
	const result = [
		{
			id:1,
			advName:"广告一"
		},
		{
			id:2,
			advName:"广告二"
		}
	];
	const age = 100;
	res.render(advList({
		age,
		result
	}));
})
// 找不到匹配的路由地址，重定向至/index/adminList
router.route('*', (req, res, next) => {
	res.redirect('/index/adminList')
})